import axios from '@/utils/request'
// 获取所有权限
export const getPermissionList = () => {
  return axios({
    url: '/sys/permission'
  })
}
// 添加权限
export const addPermission = (data) => {
  return axios({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}
// 根据id获取权限详情
export const getPermissionById = (id) => {
  return axios({
    url: `/sys/permission/${id}`
  })
}
// 更新数据
export const editPermissionById = (data) => {
  return axios({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}
// 删除权限
export const delPermissionById = (id) => {
  return axios({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}
